package br.gov.mi.corporativo.dominio.boundary.rhmi.cargo;

import java.util.List;

import javax.ws.rs.GET;
import javax.ws.rs.Path;
import javax.ws.rs.PathParam;
import javax.ws.rs.Produces;
import javax.ws.rs.core.MediaType;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.context.support.SpringBeanAutowiringSupport;

import br.gov.mi.corporativo.dominio.entidade.rhmi.Cargo;


@Path("cargos")
public class CargoRestAdapter extends SpringBeanAutowiringSupport {


	@Autowired
	private CargoEndPoint service;
	
	@GET
	@Path("/id/{id}")
	@Produces({MediaType.APPLICATION_JSON})
	public Cargo recuperarPorId(@PathParam("id")Long id){
		return service.recuperarPorId(id);
	}
	
	@GET
	@Produces({MediaType.APPLICATION_JSON})
	public List<Cargo> recuperarTodos(){
		return service.recuperarTodos();
	}
	
	@GET
	@Path("/descricao/{desc}")
	@Produces({MediaType.APPLICATION_JSON})
	public Cargo recuperarPorDescricao(@PathParam("descricao")String desc){
		return service.recuperarPorDescricao(desc);
	}
	
	@GET
	@Path("/nome/{nome}")
	@Produces({MediaType.APPLICATION_JSON})
	public Cargo recuperarPorNome(@PathParam("nome")String nome){
		return service.recuperarPorNome(nome);
	}
	
	
}
